var _EsdDynamicTransformationScript={};	 
//获取焦点添加显示边框
$("*").focus(function(){
	$(this).css({"outline":"2px dashed red"});
});
$("*").blur(function(){
	$(this).css({"outline":"0px black"});
});

//保证所有a标签都有href
$("a").each(function(){

	var aHref = this.href;
	if( aHref=="" || aHref==undefined ){
			$(this).attr("href","javascript:void(0)");
	}
	
	//给a标签加title
	var aTitle = this.title;
	var aText = this.text;
	
	if( aTitle=="" || aTitle==undefined ){
		if( aText!="" || aText!=undefined ){
			$(this).attr("title",$.trim(aText));
		}
	}
	
});

//img
$("img").each(function(){
	//给图片加alt/title
	var imgAlt = this.alt,
		imgTitle = this.title,
		imgSrc = this.src,
		parentText = this.parentElement.text;

	if(this.alt=="" || this.alt==undefined){
		if(imgTitle!="" && imgTitle!=undefined){
			$(this).attr("alt",imgTitle);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("alt",parentText);
		}
	}
	if(this.title=="" || this.title==undefined){
		if(imgAlt!="" && imgAlt!=undefined){
			$(this).attr("title",imgAlt);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("title",parentText);
		}
	}
})

$("img").each(function(){
	if( (this.alt=="" && this.title=="")||(this.alt==undefined && this.title==undefined) ){
		$(this).attr("title","图片");
		$(this).attr("alt","图片");
	}
})


//对应导航
//$("a").focus(function(){
//	 $(this).mouseover();
//});

//$("a").blur(function(){
//	 $(this).mouseout();
//});


//轮播,右下角原点--鼠标点击触发情况

//轮播：只获取轮播中一个a标签。
//以文字a标签为主，图片a标签尽量不要，title不稳定

//轮播前的标签
_EsdDynamicTransformationScript.esdTagFrontNum1 = $(".section .container .lead-headline a");

//文字A标签
_EsdDynamicTransformationScript.esdTagANum1 = $(".box-1 .box-1-1 .focusBox .txt ul li:eq(0) a");
_EsdDynamicTransformationScript.esdTagANum2 = $(".box-1 .box-1-1 .focusBox .txt ul li:eq(1) a");
_EsdDynamicTransformationScript.esdTagANum3 = $(".box-1 .box-1-1 .focusBox .txt ul li:eq(2) a");
_EsdDynamicTransformationScript.esdTagANum4 = $(".box-1 .box-1-1 .focusBox .txt ul li:eq(3) a");
_EsdDynamicTransformationScript.esdTagANum5 = $(".box-1 .box-1-1 .focusBox .txt ul li:eq(4) a");

//原点
_EsdDynamicTransformationScript.esdTagCircleNum1 = $(".box-1 .box-1-1 .focusBox ._EsdDynamicTransformationScript.num li:eq(0) a");
_EsdDynamicTransformationScript.esdTagCircleNum2 = $(".box-1 .box-1-1 .focusBox ._EsdDynamicTransformationScript.num li:eq(1) a");
_EsdDynamicTransformationScript.esdTagCircleNum3 = $(".box-1 .box-1-1 .focusBox ._EsdDynamicTransformationScript.num li:eq(2) a");
_EsdDynamicTransformationScript.esdTagCircleNum4 = $(".box-1 .box-1-1 .focusBox ._EsdDynamicTransformationScript.num li:eq(3) a");
_EsdDynamicTransformationScript.esdTagCircleNum5 = $(".box-1 .box-1-1 .focusBox ._EsdDynamicTransformationScript.num li:eq(4) a");

//轮播后的标签
_EsdDynamicTransformationScript.esdTagAfterNum1 = $(".box-1 .box-1-2 .tit ul li a");


	//轮播前的焦点
	_EsdDynamicTransformationScript.esdTagFrontNum1.focus(function (e) {
		$(document).bind("keydown.keydown_0", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum1.click();
				_EsdDynamicTransformationScript.esdTagANum1.focus();
				console.log(document.activeElement);
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagFrontNum1.blur(function () {
		$(document).unbind("keydown.keydown_0");
	});
	
	

	//第一块
	_EsdDynamicTransformationScript.esdTagANum1.focus(function (e) {
		
		_EsdDynamicTransformationScript.esdTagCircleNum1.click();
		$(document).bind("keydown.keydown_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum2.click();
				_EsdDynamicTransformationScript.esdTagANum2.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum1.blur(function () {
		$(document).unbind("keydown.keydown_1");
	});

	//第二块
	_EsdDynamicTransformationScript.esdTagANum2.focus(function (e) {
		
		_EsdDynamicTransformationScript.esdTagCircleNum2.click();
		$(document).bind("keydown.keydown_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum1.click();
				_EsdDynamicTransformationScript.esdTagANum1.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum3.click();
				_EsdDynamicTransformationScript.esdTagANum3.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum2.blur(function () {
		$(document).unbind("keydown.keydown_2");
	});
	
	//第三块
	_EsdDynamicTransformationScript.esdTagANum3.focus(function (e) {
		
		_EsdDynamicTransformationScript.esdTagCircleNum3.click();
		$(document).bind("keydown.keydown_3", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum2.click();
				_EsdDynamicTransformationScript.esdTagANum2.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum4.click();
				_EsdDynamicTransformationScript.esdTagANum4.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum3.blur(function () {
		$(document).unbind("keydown.keydown_3");
	});
	
	//第四块
	_EsdDynamicTransformationScript.esdTagANum4.focus(function (e) {
		_EsdDynamicTransformationScript.esdTagCircleNum4.click();
		$(document).bind("keydown.keydown_4", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum3.click();
				_EsdDynamicTransformationScript.esdTagANum3.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum5.click();
				_EsdDynamicTransformationScript.esdTagANum5.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum4.blur(function () {
		$(document).unbind("keydown.keydown_4");
	});
	
	//第五块
	_EsdDynamicTransformationScript.esdTagANum5.focus(function (e) {
		
		_EsdDynamicTransformationScript.esdTagCircleNum5.click();
		$(document).bind("keydown.keydown_5", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum4.click();
				_EsdDynamicTransformationScript.esdTagANum4.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagAfterNum1.focus();
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum5.blur(function () {
		$(document).unbind("keydown.keydown_5");
	});
	
	//轮播后的焦点
	_EsdDynamicTransformationScript.esdTagAfterNum1.focus(function (e) {
		
		$(document).bind("keydown.keydown_6", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum5.click();
				_EsdDynamicTransformationScript.esdTagANum5.focus();
				return false;
			}else if (e.keyCode == 9) {
				
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagAfterNum1.blur(function () {
		$(document).unbind("keydown.keydown_6");
	});
	
	

//第一部分
	//三层  
	//各个选项名称对应的内容数量
	_EsdDynamicTransformationScript.num1 = $(".box-3 .box-3-1 .common-list .common-list-items:eq(0) ul li").length-1;
	_EsdDynamicTransformationScript.num2 = $(".box-3 .box-3-1 .common-list .common-list-items:eq(1) ul li").length-1;
	_EsdDynamicTransformationScript.num3 = $(".box-3 .box-3-1 .common-list .common-list-items:eq(2) ul li").length-1;
	
	//各个选项名称
	_EsdDynamicTransformationScript.esd1TagNum1 = $(".box-3 .box-3-1 .common-list .common-list-tit li:eq(0) a");
	_EsdDynamicTransformationScript.esd1TagNum2 = $(".box-3 .box-3-1 .common-list .common-list-tit li:eq(1) a");
	_EsdDynamicTransformationScript.esd1TagNum3 = $(".box-3 .box-3-1 .common-list .common-list-tit li:eq(2) a");
	
	//各个选项中的第一个内容
	_EsdDynamicTransformationScript.esd1TagNum1Content1 = $(".box-3 .box-3-1 .common-list .common-list-items:eq(0) ul li:eq(0) a");
	_EsdDynamicTransformationScript.esd1TagNum2Content1 = $(".box-3 .box-3-1 .common-list .common-list-items:eq(1) ul li:eq(0) a");
	_EsdDynamicTransformationScript.esd1TagNum3Content1 = $(".box-3 .box-3-1 .common-list .common-list-items:eq(2) ul li:eq(0) a");
	
	//各个选项中的最后一个内容
	_EsdDynamicTransformationScript.esd1TagNum1ContentN = $(".box-3 .box-3-1 .common-list .common-list-items:eq(0) ul li:eq("+_EsdDynamicTransformationScript.num1+") a");
	_EsdDynamicTransformationScript.esd1TagNum2ContentN = $(".box-3 .box-3-1 .common-list .common-list-items:eq(1) ul li:eq("+_EsdDynamicTransformationScript.num2+") a");
	_EsdDynamicTransformationScript.esd1TagNum3ContentN = $(".box-3 .box-3-1 .common-list .common-list-items:eq(2) ul li:eq("+_EsdDynamicTransformationScript.num3+") a");
	
	//第一块
	_EsdDynamicTransformationScript.esd1TagNum1.focus(function (e) {
		console.log(1);
		e = $(this).mouseover();
		$(document).bind("keydown.keydown_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd1TagNum1Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd1TagNum1.blur(function () {
		$(document).unbind("keydown.keydown_1");
	});

	_EsdDynamicTransformationScript.esd1TagNum1Content1.focus(function () {
		$(document).bind("keydown.keydown_s1", function (e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd1TagNum1.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd1TagNum1Content1.blur(function () {
		$(document).unbind("keydown.keydown_s1");
	});

	_EsdDynamicTransformationScript.esd1TagNum1ContentN.focus(function () {
		$(document).bind("keydown.keydown_e1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd1TagNum2.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd1TagNum1ContentN.blur(function () {
		$(document).unbind("keydown.keydown_e1");
	});
	//第二块
	_EsdDynamicTransformationScript.esd1TagNum2.focus(function (e) {
		console.log(2);
		e = $(this).mouseover();
		$(document).bind("keydown.keydown_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esd1TagNum1.mouseover();
				_EsdDynamicTransformationScript.esd1TagNum1ContentN.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd1TagNum2Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd1TagNum2.blur(function () {
		$(document).unbind("keydown.keydown_2");
	});

	_EsdDynamicTransformationScript.esd1TagNum2Content1.focus(function () {
		$(document).bind("keydown.keydown_s2", function (e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd1TagNum2.focus();
				return false;
			}
		});
	});

	_EsdDynamicTransformationScript.esd1TagNum2Content1.blur(function () {
		$(document).unbind("keydown.keydown_s2");
	});

	_EsdDynamicTransformationScript.esd1TagNum2ContentN.focus(function () {
		$(document).bind("keydown.keydown_e2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd1TagNum3.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd1TagNum2ContentN.blur(function () {
		$(document).unbind("keydown.keydown_e2");
	});
	
	//第三块
	_EsdDynamicTransformationScript.esd1TagNum3.focus(function (e) {
		console.log(3);
		e = $(this).mouseover();
		$(document).bind("keydown.keydown_3", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esd1TagNum2.mouseover();
				_EsdDynamicTransformationScript.esd1TagNum2ContentN.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd1TagNum3Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd1TagNum3.blur(function () {
		$(document).unbind("keydown.keydown_3");
	});
	

//第二部分
	//三层  
	//各个选项名称对应的内容数量
	_EsdDynamicTransformationScript.num4 = $(".box-3 .box-3-2 .common-list .common-list-items:eq(0) ul li").length-1;
	_EsdDynamicTransformationScript.num5 = $(".box-3 .box-3-2 .common-list .common-list-items:eq(1) ul li").length-1;
	_EsdDynamicTransformationScript.num6 = $(".box-3 .box-3-2 .common-list .common-list-items:eq(2) ul li").length-1;
	
	//各个选项名称
	_EsdDynamicTransformationScript.esd2TagNum1 = $(".box-3 .box-3-2 .common-list .common-list-tit li:eq(0) a");
	_EsdDynamicTransformationScript.esd2TagNum2 = $(".box-3 .box-3-2 .common-list .common-list-tit li:eq(1) a");
	_EsdDynamicTransformationScript.esd2TagNum3 = $(".box-3 .box-3-2 .common-list .common-list-tit li:eq(2) a");
	
	//各个选项中的第一个内容
	_EsdDynamicTransformationScript.esd2TagNum1Content1 = $(".box-3 .box-3-2 .common-list .common-list-items:eq(0) ul li:eq(0) a");
	_EsdDynamicTransformationScript.esd2TagNum2Content1 = $(".box-3 .box-3-2 .common-list .common-list-items:eq(1) ul li:eq(0) a");
	_EsdDynamicTransformationScript.esd2TagNum3Content1 = $(".box-3 .box-3-2 .common-list .common-list-items:eq(2) ul li:eq(0) a");
	
	//各个选项中的最后一个内容
	_EsdDynamicTransformationScript.esd2TagNum1ContentN = $(".box-3 .box-3-2 .common-list .common-list-items:eq(0) ul li:eq("+_EsdDynamicTransformationScript.num4+") a");
	_EsdDynamicTransformationScript.esd2TagNum2ContentN = $(".box-3 .box-3-2 .common-list .common-list-items:eq(1) ul li:eq("+_EsdDynamicTransformationScript.num5+") a");
	_EsdDynamicTransformationScript.esd2TagNum3ContentN = $(".box-3 .box-3-2 .common-list .common-list-items:eq(2) ul li:eq("+_EsdDynamicTransformationScript.num6+") a");
	
	//第一块
	_EsdDynamicTransformationScript.esd2TagNum1.focus(function (e) {
		console.log(1);
		e = $(this).mouseover();
		$(document).bind("keydown.keydown_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd2TagNum1Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd2TagNum1.blur(function () {
		$(document).unbind("keydown.keydown_1");
	});

	_EsdDynamicTransformationScript.esd2TagNum1Content1.focus(function () {
		$(document).bind("keydown.keydown_s1", function (e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd2TagNum1.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd2TagNum1Content1.blur(function () {
		$(document).unbind("keydown.keydown_s1");
	});

	_EsdDynamicTransformationScript.esd2TagNum1ContentN.focus(function () {
		$(document).bind("keydown.keydown_e1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd2TagNum2.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd2TagNum1ContentN.blur(function () {
		$(document).unbind("keydown.keydown_e1");
	});
	//第二块
	_EsdDynamicTransformationScript.esd2TagNum2.focus(function (e) {
		console.log(2);
		e = $(this).mouseover();
		$(document).bind("keydown.keydown_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esd2TagNum1.mouseover();
				_EsdDynamicTransformationScript.esd2TagNum1ContentN.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd2TagNum2Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd2TagNum2.blur(function () {
		$(document).unbind("keydown.keydown_2");
	});

	_EsdDynamicTransformationScript.esd2TagNum2Content1.focus(function () {
		$(document).bind("keydown.keydown_s2", function (e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd2TagNum2.focus();
				return false;
			}
		});
	});

	_EsdDynamicTransformationScript.esd2TagNum2Content1.blur(function () {
		$(document).unbind("keydown.keydown_s2");
	});

	_EsdDynamicTransformationScript.esd2TagNum2ContentN.focus(function () {
		$(document).bind("keydown.keydown_e2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd2TagNum3.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd2TagNum2ContentN.blur(function () {
		$(document).unbind("keydown.keydown_e2");
	});
	
	//第三块
	_EsdDynamicTransformationScript.esd2TagNum3.focus(function (e) {
		console.log(3);
		e = $(this).mouseover();
		$(document).bind("keydown.keydown_3", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esd2TagNum2.mouseover();
				_EsdDynamicTransformationScript.esd2TagNum2ContentN.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd2TagNum3Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd2TagNum3.blur(function () {
		$(document).unbind("keydown.keydown_3");
	});
	